/*
 * @Author: yovi
 * @Date: 2019-11-19 09:05:30
 * @LastEditTime: 2019-11-23 10:10:23
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \YouYouFo\you-you-go\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Member from '../views/Member.vue'
import ShoppingCart from '../views/ShoppingCart.vue'
import Search from '../views/Search.vue'
import NewsList from '@/views/news/NewsList.vue'
import NewsDetail from '@/views/news/NewsDetail.vue'
import PicShareList from '@/views/pictureShare/PicShareList.vue'
import PicShareDetail from '@/views/pictureShare/PicDetail.vue'
import GoodsList from '@/views/goods/GoodsList.vue'
import Goods from '@/views/goods/Goods.vue'
import GoodsDetail from '@/views/goods/GoodsDetail.vue'
import GoodsComment from '@/views/goods/GoodsComment.vue'
import AddGoods from '@/views/goods/AddGoods.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/index'
  },
  // 首页路由
  {
    path: '/index',
    component: Index,
  },

  // 会员路由
  {
    path: '/members',
    component: Member
  },

  // 购物车路由
  {
    path: '/shoppingCart',
    component: ShoppingCart
  },

  // 搜索路由
  {
    path: '/search',
    component: Search
  },

  // 新闻资讯列表路由
  {
    path: '/newsList',
    component: NewsList
  },

  // 新闻资讯详情路由
  {
    path: '/newsDetail/:id',
    component: NewsDetail
  },

  // 图片分享路由
  {
    path: '/pictureShare',
    component: PicShareList
  },

  //图片详情路由
  {
    path: '/pictureDetail',
    component: PicShareDetail
  },

  // 商品列表路由
  {
    path: '/goodsList',
    component: GoodsList
  },

  // 单个商品展示路由
  {
    path: '/goods/:id',
    component: Goods
  },

  // 商品图文介绍路由
  {
    path: '/goodsDetail/:id',
    component: GoodsDetail
  },

  // 商品图文评论路由
  {
    path: '/goodsComment/:id',
    component: GoodsComment
  },

  // 添加商品
  {
    path: '/addGoods',
    component: AddGoods
  },

]

const router = new VueRouter({
  routes
})

export default router
